﻿using FileZillaConfig.Types;

namespace FileZillaConfig.ConfigClasses
{
    public class SSL
    {
        private bool _enabled;
        private string _keyFile;
        private string _certFile;
        private string _password;
        private bool _allowExplicit;
        private bool _forcePROTP;
        private bool _disallowPlain;
        private PortsList _implicitSSLPorts;

        public SSL()
        {
            this._implicitSSLPorts = new PortsList();
        }

        /// <summary>
        /// Listen for implicit SSL/TLS connections on the following ports
        /// </summary>
        public PortsList ImplicitSSLPorts
        {
            get { return _implicitSSLPorts; }
        }


        /// <summary>
        /// Disallow plain unencrypted FTP
        /// </summary>
        public bool DisallowUnencrypted
        {
            get { return _disallowPlain; }
            set { _disallowPlain = value; }
        }


        /// <summary>
        /// Force PROT P to encrypt file transfers in SSL/TLS mode
        /// </summary>
        public bool ForcePROTPEncryption
        {
            get { return _forcePROTP; }
            set { _forcePROTP = value; }
        }


        /// <summary>
        /// Allow explicit FTP over SSL
        /// </summary>
        public bool AllowExplicitFTP
        {
            get { return _allowExplicit; }
            set { _allowExplicit = value; }
        }


        /// <summary>
        /// SSL Key password (stored as plain text)
        /// </summary>
        public string KeyPassword
        {
            get { return _password; }
            set { _password = value; }
        }


        /// <summary>
        /// Certificate file
        /// </summary>
        public string SSLCertFile
        {
            get { return _certFile; }
            set { _certFile = value; }
        }


        /// <summary>
        /// Private key file
        /// </summary>
        public string SSLKeyFile
        {
            get { return _keyFile; }
            set { _keyFile = value; }
        }


        /// <summary>
        /// Enable FTP over SSL/TLS (FTPS)
        /// </summary>
        public bool Enabled
        {
            get { return _enabled; }
            set { _enabled = value; }
        }

    }
}
